function th5dump()

%   Copyright 2008-2009 The MathWorks, Inc.

fprintf ('\nStarting H5DUMP tests.\n' );
test_example;  
test_dataset_reference;  
test_bitfield;  
fprintf ('Finishing H5DUMP tests.\n' );
return


%--------------------------------------------------------------------------
function test_example()
% Dump example.h5

d = load('th5dump.mat');


output_text = evalc('h5dump(''example.h5'');');
if ~strcmp(d.example,output_text)
    error('failed');
end





%--------------------------------------------------------------------------
function test_dataset_reference()
% Test a reference dataset dump.

d = load('th5dump.mat');

cmd = 'h5dump(''data/h5ex_t_objref.h5'',''/DS1'');';
output_text = evalc(cmd);
if ~strcmp(d.reference_dataset_dump,output_text)
    error('failed');
end






%--------------------------------------------------------------------------
function test_bitfield()
% Test a bitfield dump.

d = load('th5dump.mat');

cmd = 'h5dump(''data/h5ex_t_bit.h5'',''DS1'');';
output_text = evalc(cmd);
if ~strcmp(d.bitfield_dataset_dump,output_text);
    error('failed');
end

